//
//  YDOAExpenseAccountApplyVC.swift
//  YDOAProduct
//
//  Created by 占益民 on 2017/11/25.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit

class YDOAExpenseAccountApplyVC: UIViewController {
    @IBOutlet weak var voucherImg: UIImageView!
    @IBOutlet weak var remarkTF: UITextField!
    
    @IBOutlet weak var documentTF: UITextField!
    @IBOutlet weak var subjectTF: UITextField!
    @IBOutlet weak var amountTF: UITextField!
    @IBOutlet weak var abstractTF: UITextField!
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "费用报销申请"
        self.navigationController?.navigationBar.isHidden = false
        self.automaticallyAdjustsScrollViewInsets = false
        self.edgesForExtendedLayout = .init(rawValue: 0)
        
        //给图片添加点击事件
        voucherImgAddTap()
    }

    func voucherImgAddTap(){
        let tapGest = UITapGestureRecognizer(target: self, action: #selector(tap))
        voucherImg.addGestureRecognizer(tapGest)
    }
    
    @objc func tap(tap : UIGestureRecognizer) {
        YMLog.log(item: "选择图片")
        let imgPickerVC  = YMImgPickerVC()
        imgPickerVC.modalPresentationStyle = .overCurrentContext //模态视图的展现形式
        imgPickerVC.view.backgroundColor = UIColor(white: 0.3, alpha: 0.7) //视图的背景颜色
        
        weak var weakSelf = self
        imgPickerVC.callbackWithImg = {(imgData:Data) in
            weakSelf?.voucherImg.image = UIImage(data: imgData)
        }
        
        self.present(imgPickerVC, animated: true, completion: {
            
        })

    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
//提交申请
    @IBAction func senderApply(_ sender: Any) {
        
        
    }
    
}
